#ifndef GLWIDGET_H
#define GLWIDGET_H

#include "../lbm2d.h"
#include <cmath>
#include <QtGui>
#include <QGLWidget>
#include <QBrush>
#include <QFont>
#include <QPen>

class QPainter;
class QPaintEvent;
class QWidget;

class GLWidget : public QGLWidget {
	Q_OBJECT

	public:
		GLWidget(QWidget *parent);
		void paint(QPainter *painter, QPaintEvent *event, int elapsed);
		void drawArrow(QPainter *painter, QPoint p0, QPointF scale, double angle);

	public slots:
		void animate();

	protected:
		void paintEvent(QPaintEvent *event);

	private:
		int elapsed;
		QBrush background;
		QPen arrowPen;
		QColor arrowColor;

		double toPixels;
		double uMax;

		LBM lbm;
};

#endif
